package org.qqcui.designpattern.patterns.memorandum.game;

/**
 * desc
 *
 * @author cuiqingqiang
 * @version 1.0
 * @date 2022/5/7 10:30
 **/
public class GameRole {

    private int vit;

    private int def;

    public int getVit() {
        return vit;
    }

    public void setVit(int vit) {
        this.vit = vit;
    }

    public int getDef() {
        return def;
    }

    public void setDef(int def) {
        this.def = def;
    }

    public Memento createMemento() {
        return new Memento(vit, def);
    }

    public void recoverFromMemento(Memento memento) {
        this.vit = memento.getVit();
        this.def = memento.getDef();
    }

    public void display() {
        System.out.println("当前攻击力：" + vit + "，防御力：" + def);
    }
}
